<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport"content="width=device-width,initial-scale=1.0" />
		<title>博客管理</title>
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
		<link rel="stylesheet" href="../../lib/editormd/css/editormd.min.css" th:href="@{/lib/editormd/css/editormd.min.css}" />
		<link rel="stylesheet" type="text/css" href="../../css/me.css" th:href="@{/css/me.css}"/>
	</head>
	<body onload="loadINFO()">
	<nav th:replace="admin/_fragments :: menu(1)" class="ui inverted  attached segment m-padded-tb-mini m-shadow-small"  >

	</nav>
		<!--二级导航-->
		<div class="ui attached pointing menu">
			<div class="ui container">
				<div class="right menu">
					<a href="#" class="active teal item">发布</a>
					<a href="#" class=" item">列表</a>
				</div>
				</div>
			
		</div>
		<div class=" m-padded-tb-big m-container">
				<div class="ui stackable container">
					<!--头部-->
					<div class="ui form">
						<div class="required field">
							<div class="ui left labeled input">
							<div class="ui  selection compact teal basic dropdown label">
								<input type="hidden" name="" id="flag" value="原创" th:value="${blog.flag}" />
								<i class="dropdown icon"></i>
								<div class=" text">原创</div>
								<div class="menu">
									<div class="item" data-value="原创">原创</div>
									<div class="item" data-value="转载">转载</div>
									<div class="item" data-value="翻译">翻译</div>
								</div>
							</div>
								<input type="text" name="title" id="title" value="" placeholder="标题" th:value="${blog.title}" />
							</div>
							<textarea id="description" placeholder="博客概述" name="description" th:text="${blog.description}" style="margin-top:0px;margin-bottom:0px;height:110px;"></textarea>


						</div>
						<div class="field">
							<div class="field">
								<div id="md-content"style="z-index: 1 !important;">
<!--									文本输入区域-->
									<textarea id="content" placeholder="博客内容" name="content" th:text="${blog.content}" style="display: none;"></textarea>
								</div>
							</div>
							
						</div>
						<div class="two fields">
							<div class="field">
								<div class="ui left labeled action input">
									<label for="" class="ui compact teal basic label">分类</label>
									<div class="ui fluid selection dropdown">
										<input type="hidden" name="type" id="type" value="" th:value="${blog.type}" />
										<i class="dropdown icon"></i>
										<div id="type_text" class="default text">分类</div>
										<div id="type_menu" class="menu">
											<div class="item" data-value="1">错误日志</div>
											<div class="item" data-value="2">开发者手册</div>
										</div>
									</div>
								</div>
							</div>
							<div class="field">
								<div class="ui left labeled action input">
									<label for="" class="ui compact teal basic label">标签</label>
									<div class="ui fluid selection dropdown">
										<input type="hidden"  id="tags" value="" th:value="${blog.tags}" />
										<i class="dropdown icon"></i>
										<div id="tag_text" class="default text">标签</div>
										<div id="tags_menu" class="menu">
											<div class="item" data-value="1">Python</div>
											<div class="item" data-value="2">Javascript</div>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="field">
							<div class="ui left labeled input">
								<label for="" class="ui teal basic label">首图</label>
								<input type="text" name="indexPicture" placeholder="首图引用地址" id="first_p" th:value="${blog.firstPicture}"  />
							</div>
							
						</div>
						<div class="inline fields">
							<div class="field">
								<div class="ui checkbox">
									<input type="checkbox" name="recommend" id="recommend" class="hidden" th:checked="${blog.recommend}>0" />
									<label for="recommend">推荐</label>
								</div>
							</div>
							<div class="field">
								<div class="ui checkbox">
									<input type="checkbox" name="shareInfo" id="shareInfo" class="hidden" th:checked="${blog.share}>0"/>
									<label for="shareInfo">转载声明</label>
								</div>
							</div>
							<div class="field">
								<div class="ui checkbox">
									<input type="checkbox" id="appreciation" class="hidden" th:checked="${blog.appreciation}>0" />
									<label for="appreciation">赞赏</label>
								</div>
							</div>
							<div class="field">
								<div class="ui checkbox">
									<input type="checkbox" id="comment" class="hidden" th:checked="${blog.commentable}>0" />
									<label for="comment">评论</label>
								</div>
							</div>
						</div>
						<div class="ui error message"></div>
						<div class="ui right aligned container">
<!--							文章id-->
							<input type="hidden" id="id" th:value="${id}"/>
							<button class="ui button" type="button" onclick="window.history.go(-1)">返回</button>
<!--							value 用来判断是否发布-->
							<button id="btn-save" class="ui secondary button" value="0">保存</button>
							<button id="btn-publish" class="ui teal  button" value="1">发布</button>
						</div>
					</div>
				</div>	
				</div>
		<br />
		<br />
	<footer th:replace="admin/_fragments :: footer" class="ui inverted vertical segment m-padded-tb-massive" >

	</footer>
		<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
		<script src="../../lib/editormd/editormd.amd.min.js" th:src="@{/lib/editormd/editormd.amd.min.js}"></script>
		<script th:src="@{/js/blogEdit.js}"></script>
		<script>
			/*markdown初始化*/
			var contentEditor;
            $(function() {
                contentEditor = editormd("md-content", {
                    width   : "100%",
                    height  : 640,
                    syncScrolling : "single",
                    path    : "../../lib/editormd/lib/"
                });
             });
			$('.menu.toggle').click(function(){
				$('.m-item').toggleClass('m-mobile-hide');
			});
			$('.ui.dropdown').dropdown({
				on: 'hover'
			});
			$('.ui.form').form({
				fields : {
					title : {
						identifier: 'title',
						rules: [{
							type : 'empty',
							prompt : '标题，请输入博客标题'
						}]
					}
				}
			});
			$('#newBlog-container').load(/*[[@{/footer/newblog2}]]*/"/footer/newblog2");
		</script>
	</body>
</html>
